/**
 * 
 */
package org.strangewt.demo.composit;

import static org.strangewt.demo.widgets.DemoWidgetHelper.*;

import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;

/**
 * @author strange optics
 *
 */
public class GroupDemoWidgetHelper extends Group implements SelectionListener {

	/**
	 * @param parent
	 * @param style
	 */
	public GroupDemoWidgetHelper(Composite parent, int style) {
		super(parent, style);

		createControl(this);
	}

	private void createControl(Composite parent) {
		
		parent.setLayout(new GridLayout(2, false));
		
		createLabel(parent, "label0");
		createText(parent);
		
		createLabelTop(parent, "label1");
		createTextField(parent, 0, 50);
		
		createLabelTop(parent, "label2");
		createTextField(parent, 0, 50, 1, 2);
		createLabelTop(parent, "label3");
		
		Composite composite = createComposite(parent, 2);
		composite.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 2, 1));
		createButton(composite, "OK", this);
		createButton(composite, "CANCEL", this);
	}
	
	@Override
	protected void checkSubclass() {
	}

	// SelectionListener //////////////////////////////////////////////
	
	@Override
	public void widgetSelected(SelectionEvent e) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void widgetDefaultSelected(SelectionEvent e) {
		// TODO Auto-generated method stub
		
	}
}
